<template>
	<view class="wrap safe-area">
		<view class="wrap-search">
			<view class="search-box flex align-center">
				<image class="search-img" src="/static/images/search_gray.png" />
				
				<input class="input" placeholder="搜索" placeholder-class="place" />
			</view>
		</view>
		
		<view class="wrap-list">
			<block v-for="(item, index) in list" :key="index">
				<view class="item flex column">
					<view class="title" v-if="item.hasOwnProperty('title')">
						{{ item.title }}
					</view>
					
					<view class="white-list">
						<block v-for="(subItem, idx) in item.list" :key="idx">
							<view class="subItem flex align-center" @click="onItem(subItem)">
								<image class="file" :src="subItem.file" />
								
								<view class="right flex align-center just-between">
									<view class="name">
										{{ subItem.title }}
									</view>
									
									<image class="arrow" v-if="subItem.isArrow" src="/static/images/arrow_right.png" />
									
									<view v-else class="content">
										{{ subItem.content }}
									</view>
								</view>
							</view>
						</block>
					</view>
				</view>
			</block>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list: [
					{
						title: "账号",
						list: [
							{
								file: "/static/images/zhyaq.png",
								title: "账号与安全",
								isArrow: true,
								isJump: true,
							},
							{
								file: "/static/images/yssz.png",
								title: "隐私设置",
								isArrow: true,
								isJump: false,
							},
							{
								file: "/static/images/zfsz.png",
								title: "支付设置",
								isArrow: true,
								isJump: false,
							}
						]
					},
					{
						title: "通用",
						list: [
							{
								file: "/static/images/setting.png",
								title: "通用设置",
								isArrow: true,
								isJump: false,
							},
							{
								file: "/static/images/tzsz.png",
								title: "通知设置",
								isArrow: true,
								isJump: false,
							},
							{
								file: "/static/images/tzxxgl.png",
								title: "通知消息管理",
								isArrow: true,
								isJump: false,
							},
							{
								file: "/static/images/ltsz.png",
								title: "聊天设置",
								isArrow: true,
								isJump: false,
							},
							{
								file: "/static/images/bfsz.png",
								title: "播放设置",
								isArrow: true,
								isJump: false,
							},
							{
								file: "/static/images/bjsz.png",
								title: "背景设置",
								isArrow: true,
								isJump: false,
							},
							{
								file: "/static/images/zbms.png",
								title: "长辈模式",
								isArrow: true,
								isJump: false,
							},
							{
								file: "/static/images/ztdx.png",
								title: "字体大小",
								isArrow: true,
								isJump: false,
							},
							{
								file: "/static/images/jsxnms.png",
								title: "极速性能模式",
								isArrow: true,
								isJump: false,
							},
							{
								file: "/static/images/qlhc.png",
								title: "清理缓存",
								isArrow: false,
								content: "200MB",
								isJump: false,
							}
						]
					},
					{
						title: "关于",
						list: [
							{
								file: "/static/images/gydy.png",
								title: "关于抖音",
								isArrow: true,
								isJump: false,
							},
							{
								file: "/static/images/ad.png",
								title: "了解与管理广告推送",
								isArrow: true,
								isJump: false,
							},
							{
								file: "/static/images/fkybz.png",
								title: "反馈与帮助",
								isArrow: true,
								isJump: false,
							},
							{
								file: "/static/images/dygzzx.png",
								title: "抖音规则中心",
								isArrow: true,
								isJump: false,
							},
							{
								file: "/static/images/zizhizhengzhao.png",
								title: "资质证照",
								isArrow: true,
								isJump: false,
							},
							{
								file: "/static/images/user_agree.png",
								title: "用户协议",
								isArrow: true,
								isJump: false,
							},
							{
								file: "/static/images/privacy.png",
								title: "隐私政策与简明版",
								isArrow: true,
								isJump: false,
							},
							{
								file: "/static/images/yyqx.png",
								title: "应用权限",
								isArrow: true,
								isJump: false,
							},
							{
								file: "/static/images/grxxsjqd.png",
								title: "个人信息收集清单",
								isArrow: true,
								isJump: false,
							},
							{
								file: "/static/images/dsfxxgxqd.png",
								title: "第三方信息共享清单",
								isArrow: true,
								isJump: false,
							},
							{
								file: "/static/images/grxxgl.png",
								title: "个人信息管理",
								isArrow: true,
								isJump: false,
							},
							{
								file: "/static/images/kyrjsm.png",
								title: "开源软件声明",
								isArrow: true,
								isJump: false,
							}
						]
					},
					{
						list: [
							{
								file: "/static/images/change_account.png",
								title: "切换账号",
								isArrow: true,
								isJump: false,
							},
							{
								file: "/static/images/tcdl.png",
								title: "退出登录",
								isArrow: true,
								isJump: false,
							}
						]
					}
				]
			};
		},
		methods: {
			/**
			 * 点击
			 */
			onItem(subItem) {
				if (subItem.isJump) {
					uni.navigateTo({
						url: "/pages/mine/account/account"
					})
				}
			}
		}
	}
</script>

<style lang="scss">
	page {
		background-color: #F6F6F6;
	}
	
	.wrap {
		box-sizing: border-box;
		
		.wrap-search {
			width: 100%;
			overflow: hidden;
			padding: 20rpx 30rpx;
			box-sizing: border-box;
			
			.search-box {
				width: 100%;
				height: 60rpx;
				border-radius: 20rpx;
				overflow: hidden;
				background-color: #EEEEEE;
				padding: 0rpx 20rpx;
				box-sizing: border-box;
				gap: 20rpx;
				
				.search-img {
					width: 30rpx;
					height: 30rpx;
				}
				
				.input {
					flex: 1;
					overflow: hidden;
					color: #333333;
					font-size: 30rpx;
				}
				
				.place {
					color: #999999;
					font-size: 30rpx;
				}
			}
		}
		
		.wrap-list {
			margin-top: 30rpx;
			width: 100%;
			overflow: hidden;
			padding: 0rpx 30rpx;
			box-sizing: border-box;
			
			.item {
				width: 100%;
				overflow: hidden;
				margin-bottom: 30rpx;
				gap: 20rpx;
				
				.title {
					margin-left: 30rpx;
					color: #666666;
					font-size: 26rpx;
				}
				
				.white-list {
					width: 100%;
					overflow: hidden;
					background-color: white;
					border-radius: 20rpx;
					
					.subItem {
						width: 100%;
						overflow: hidden;
						padding-left: 30rpx;
						box-sizing: border-box;
						gap: 30rpx;
						
						.file {
							width: 40rpx;
							height: 40rpx;
						}
						
						.right {
							flex: 1;
							overflow: hidden;
							height: 100rpx;
							border-bottom: 2rpx solid #EEEEEE;
							padding-right: 30rpx;
							box-sizing: border-box;
							
							.name {
								color: #333333;
								font-size: 30rpx;
							}
							
							.arrow {
								width: 30rpx;
								height: 30rpx;
							}
							
							.content {
								color: #666666;
								font-size: 30rpx;
							}
						}
					}
				}
			}
		}
	}
</style>
